Re: [GENERAL] Problems with '||' concatenation operator. - Mailing list pgsql-general

From Stuart Rison
Subject Re: [GENERAL] Problems with '||' concatenation operator.
Date
Msg-id v04020a06b36746d83f4f@[128.40.242.190]
Whole thread Raw
In response to Problems with '||' concatenation operator.  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
List pgsql-general
>Beth Strohmayer wrote
>
>>cgh=> select chromosome || arm as locus from experiment;
>>ERROR:  There is more than one possible operator '||' for types 'varchar'
>>and 'b
>>pchar'
>>        You will have to retype this query using an explicit cast
>>cgh=>
>
>Try select chromosome || varchar(arm) as locus from experiment;
>

Doesn't work for me,

cgh=> select chromosome || varchar(arm) as locus from experiments;
ERROR:  parser: Syntax error at or near "arm"

neither does select chromosome || arm::varchar as locus from experiment;

but the solution is clearly in some form of casting!

I'm using PG 6.4, perhaps it's a version thing?

regards,

S.






+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street               |
| Tel. (0171) 878 4041    | London, W1P 8BT, UNITED KINGDOM.     |
| Fax. (0171) 878 4040    | stuart@ludwig.ucl.ac.uk              |
+-------------------------+--------------------------------------+

pgsql-general by date:

Previous
From: Stuart Rison
Date:
Subject: Problems with '||' concatenation operator.
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: [GENERAL] select from into question